package com.hnas.eCard.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.hnas.eCard.dao.CommoditDao;
import com.hnas.eCard.orm.Commodit;
import com.hnas.eCard.service.CommoditService;
import com.hnas.eCard.service.dto.search.DTOCommoditSearch;

@Component("commoditService")
@Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
public class CommoditServiceImpl implements CommoditService{

	@Autowired
	private CommoditDao commoditDao;

	@Override
	public Commodit findById(String id) {
		return commoditDao.find(id);
	}

	@Override
	public List<Commodit> pageByMrchId(DTOCommoditSearch criteria) {
		return commoditDao.pageByMrchId(criteria);
	}
}
